<div style="min-width:950px;">
<nz-breadcrumb class="breadcrumb-pos">
  <i nz-icon type="link" theme="outline" style="color:#1890FF;padding-right:4px"></i>
  <nz-breadcrumb-item>
    维修员管理
  </nz-breadcrumb-item>
</nz-breadcrumb>
<div nz-row [nzGutter]="16" style="border-bottom: 1px solid #ccc;margin-bottom: 8px;">
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>姓名</nz-form-label>
      <nz-form-control>
        <input nz-input  [(ngModel)]="name">
      </nz-form-control>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>手机号</nz-form-label>
      <nz-form-control>
        <input nz-input  [(ngModel)]="mobile">
      </nz-form-control>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>邀请状态</nz-form-label>
      <nz-select [(ngModel)]="isJoinOrg" style="margin-top:3px;width: 90px;">
        <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
        <nz-option [nzLabel]="'待确认'" [nzValue]="'0'"></nz-option>
        <nz-option [nzLabel]="'未同意'" [nzValue]="'1'"></nz-option>
        <nz-option [nzLabel]="'已同意'" [nzValue]="'2'"></nz-option>
        <nz-option [nzLabel]="'个人解除'" [nzValue]="'3'"></nz-option>
      </nz-select>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="4">
    <nz-form-item nzFlex>
      <nz-form-label>状态</nz-form-label>
      <nz-select [(ngModel)]="status" style="margin-top:3px;width: 90px;">
        <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
        <nz-option [nzLabel]="'启用'" [nzValue]="'0'"></nz-option>
        <nz-option [nzLabel]="'禁用'" [nzValue]="'1'"></nz-option>
      </nz-select>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>账号类型</nz-form-label>
      <nz-select [(ngModel)]="type" style="margin-top:3px;width: 90px;">
        <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
        <nz-option [nzLabel]="'普通'" [nzValue]="'0'"></nz-option>
        <nz-option [nzLabel]="'管理'" [nzValue]="'1'"></nz-option>
      </nz-select>
      <button nz-button [nzType]="'primary'" [nzLoading]="btn_loading" style="margin:3px 0 0 20px;" (click)="getTenantlist()">查询</button>
    </nz-form-item>
  </div>
</div>

<div class="add_btn">
  <button nz-button nzType="primary" routerLink="/main/addmaint"><i nz-icon type="plus"></i>添加</button>
  <button nz-button style="float:right" (click)="exportOut()">导出Excel</button>
</div>
<nz-table #basicTable [nzData]="maintlist" [nzLoading]="loading" [nzShowPagination]="false" [nzBordered]="true">
  <thead>
    <tr>
      <th>姓名</th>
      <th>手机号</th>
      <th>状态</th>
      <th>邀请状态</th>
      <th>账号类型</th>
      <th>完成工单量</th>
      <th>待完成工单量</th>
      <th>故障任务量</th>
      <th>预警任务量</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of maintlist">
      <td>{{data.name}}</td>
      <td>{{data.mobile}}</td>
      <td>{{data.statusStr}}</td>
      <td>{{data.isJoinOrgStr}}</td>
      <td [ngClass]="{'ordinary':data.type==0,'Violet':data.type==1}">{{data.typeStr}}</td>
      <td>{{data.taskOrderSum-data.orderTodoSum}}</td>
      <td>{{data.orderTodoSum}}</td>
      <td>{{data.taskErrSum}}</td>
      <td>{{data.taskEarlySum}}</td>
      <td class="td_btn">
        <a style="margin-right:12px;" routerLink="/main/editmaint/{{data.id}}">编辑</a>
        <a style="color:rgb(36, 184, 99);margin-right:12px;" routerLink="/main/maintinfo/{{data.id}}">详情</a>
        <nz-popconfirm  [nzTitle]="'确定要删除么?'" (nzOnConfirm)="delete(data.id)">
          <a nz-popconfirm style="color:rgb(224, 68, 41);">删除</a>
        </nz-popconfirm>
        <br>
          <a *ngIf="data.isJoinOrg == 1 || data.isJoinOrg == 3" style="color:rgb(198, 45, 211);margin-right:12px;" (click)="inviteAgain(data.id)">重新邀请</a>
          <a style="color:rgb(17, 44, 165);" (click)="setArea(data.id)">区域配置</a>
      </td>
    </tr>
  </tbody>
</nz-table>
<nz-pagination style="float:right;margin-top:12px;" [nzPageIndex]="PageIndex" [nzPageSize]="PageSize" [nzTotal]="PageTotal" (nzPageIndexChange)="PageIndexChange($event)" [nzHideOnSinglePage]="true" [nzShowTotal]="totalTemplate"></nz-pagination>
<ng-template #totalTemplate let-total>
  共 {{total}} 条数据
</ng-template>
<nz-modal [nzWidth]="700" [(nzVisible)]="isVisible" nzTitle="维修员区域配置" [nzFooter]="null" (nzOnCancel)="handleCancel()">
  <app-setarea [id]="childValue"></app-setarea>
</nz-modal>
</div>